package com.four.bmm.controller;

import com.four.bmm.entity.News;
import com.four.bmm.service.NewsService;
import com.four.bmm.util.PageUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/SelectNewsListServlet")
public class SelectNewsListServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        NewsService newsService = new NewsService();
        String pageno1 = request.getParameter("pageno");
        List<News> newsList = newsService.GetAllNewsNoPage();
        request.setAttribute("newsList",newsList);
        response.sendRedirect("iPush.jsp");

    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }
}
